#!/usr/bin/python3

# Access python's config files from bash.
# Usage: get-conf-item filename.conf section item default

from __future__ import absolute_import
from __future__ import print_function
import sys

try:
    from vdsm.config import config
except:
    from six.moves import configparser
    config = configparser.ConfigParser()

(dummy, file, section, item, default) = sys.argv
config.read(file)
try:
    print(config.get(section, item))
except:
    print(default)
